/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __LIB3D_HARD_TEXTUREREFLECTION_H__
#define __LIB3D_HARD_TEXTUREREFLECTION_H__

#include <Converter.h>
#include <lib3d/math.h>
#include <pictureformat/PictureFormat.h>

namespace liba
{
namespace lib3d
{
namespace hard
{

class TextureReflection
{
public:
	enum Type { SPHERIC, CUBIC };
	explicit TextureReflection(Type type)
	:	type( type )
	{}
	virtual ~TextureReflection()
	{}
	int get_type()const
	{
		return type;
	}
	/** Should never return 0 */
	virtual void * lock(int plane, int * stride, int width, int height, const pictureformat::Format & pf)=0;
	virtual void unlock(int plane)=0;
	virtual bool is_valid()=0;
	virtual bool set_in_hardware(int stage, double factor, const Matrix & mat)=0;
private:
	Type type;
};


} // namespace hard
} // namespace lib3d

namespace converter
{
extern EnumPair<char,lib3d::hard::TextureReflection::Type> Lib3DHardTextureReflectionTypeNames[];

template<>
struct ConverterTraits<char,lib3d::hard::TextureReflection::Type>
	:	public ConverterTraitsEnumBase<char, lib3d::hard::TextureReflection::Type, Lib3DHardTextureReflectionTypeNames>
{};
template<>
struct ConverterTraitsSelector<lib3d::hard::TextureReflection::Type> : public ConverterTraitsSelectorLocalBase<lib3d::hard::TextureReflection::Type>
{};

} // namespace converter


} // namespace liba
using namespace liba;

#endif //__LIB3D_HARD_TEXTUREREFLECTION_H__

